home *** CD-ROM | disk | FTP | other *** search
/ Visual Cafe 3 / Visual Cafe 3.ISO / Vcafe / Main.bin / ActionBeanInfo.java < prev    next >
Text File  |  1998-09-18  |  2KB  |  70 lines

  1. package com.symantec.itools.swing.actions;
  2.  
  3. import java.beans.*;
  4. import java.util.ResourceBundle;
  5. import com.symantec.itools.vcafe.beans.BeanDescriptorAttributes;
  6. import com.symantec.itools.swing.DesignTimeResourceBundle;
  7. //import com.symantec.itools.vcafe.openapi.beans.DesignTimeDnd;
  8. //import com.symantec.itools.vcafe.openapi.beans.DesignTimeOnDrop;
  9.  
  10. public final class ActionBeanInfo
  11.     extends com.symantec.itools.beans.HelperBeanInfo
  12. {
  13.     public ActionBeanInfo()
  14.     {
  15.         ResourceBundle resources = ResourceBundle.getBundle("com.symantec.itools.swing.DesignTimeResourceBundle");
  16.         setComponentLibraryFolder(resources.getString(DesignTimeResourceBundle.ACTIONS_FOLDER_KEY));
  17.         
  18.         set16x16ColorIconName("Action.gif");
  19.     }
  20.  
  21.     protected Class getBeanClass()
  22.     {
  23.         return Action.class;
  24.     }
  25.  
  26.     protected void modifyBeanDescriptor(BeanDescriptor beanDescriptor)
  27.     {
  28.         super.modifyBeanDescriptor(beanDescriptor);
  29.  
  30.         //???RKM??? This does not work yet, take it out for the beta
  31.         /*
  32.         try
  33.         {
  34.             Class dtHelper;
  35.  
  36.             // this is currently locaed in symclass.zip...
  37.             dtHelper = Class.forName("com.symantec.itools.swing.actions.ActionDTHelper");
  38.             // NO NO NO NO - use reflection!
  39.             // beanDescriptor.setValue(DesignTimeDnd.DESIGNTIME_DND_ATTRIBUTE, dtHelper);
  40.             // beanDescriptor.setValue(DesignTimeOnDrop.DESIGNTIME_ON_DROP_ATTRIBUTE, dtHelper);
  41.         }
  42.         catch(ClassNotFoundException ex)
  43.         {
  44.         }
  45.         */
  46.  
  47.         beanDescriptor.setValue(BeanDescriptorAttributes.ABSTRACT_BEAN_ATTRIBUTE, Boolean.TRUE);
  48.  
  49.         beanDescriptor.setValue("WINHELP", winHelpID);
  50.  
  51.         beanDescriptor.setValue
  52.             ("ROOTTEMPLATE",
  53.                 "import java.awt.*;\n" +
  54.                 "import com.sun.java.swing.*;\n" +
  55.                 "\n" +
  56.                 "public class Action1 extends com.symantec.itools.swing.actions.Action\n" +
  57.                 "{\n" +
  58.  
  59.                 "\tpublic void actionPerformed(java.awt.event.ActionEvent e)\n" +
  60.                 "\t{\n" +
  61.                 "\t\t// Add code here to do your custom action\n" +
  62.                 "\t}\n" +
  63.  
  64.                 "}\n"
  65.             );
  66.     }
  67.  
  68.     protected final static String winHelpID = "0x6012C";
  69. }
  70.